package xiebian

class GrandFather(var name:String)
class Father(name:String) extends GrandFather(name)
class Son(name:String) extends Father(name)
// 斜边
class Card[+T](val name:String, val t :T)

object XieBianDemo {
  def doThings(card:Card[GrandFather]): Unit ={
    println(card.name + "....." + card.t.asInstanceOf[GrandFather].name )
  }
  def main(args: Array[String]): Unit = {
    val card = new Card[GrandFather]("card", new Son("son"))
    doThings(card)
  }
}
